/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package co.com.entidad;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author 841756
 */
@Entity
@Table(name = "tblestadocivil")
@NamedQueries({
    @NamedQuery(name = "Tblestadocivil.findAll", query = "SELECT t FROM Tblestadocivil t"),
    @NamedQuery(name = "Tblestadocivil.findByIdEstadocivil", query = "SELECT t FROM Tblestadocivil t WHERE t.idEstadocivil = :idEstadocivil"),
    @NamedQuery(name = "Tblestadocivil.findByDesEstadocivil", query = "SELECT t FROM Tblestadocivil t WHERE t.desEstadocivil = :desEstadocivil")})
public class Tblestadocivil implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 3)
    @Column(name = "id_estadocivil")
    private String idEstadocivil;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "des_estadocivil")
    private String desEstadocivil;
    @JoinColumn(name = "id_estado", referencedColumnName = "id_estado")
    @ManyToOne(optional = false)
    private TblEstado idEstado;

    public Tblestadocivil() {
    }

    public Tblestadocivil(String idEstadocivil) {
        this.idEstadocivil = idEstadocivil;
    }

    public Tblestadocivil(String idEstadocivil, String desEstadocivil) {
        this.idEstadocivil = idEstadocivil;
        this.desEstadocivil = desEstadocivil;
    }

    public String getIdEstadocivil() {
        return idEstadocivil;
    }

    public void setIdEstadocivil(String idEstadocivil) {
        this.idEstadocivil = idEstadocivil;
    }

    public String getDesEstadocivil() {
        return desEstadocivil;
    }

    public void setDesEstadocivil(String desEstadocivil) {
        this.desEstadocivil = desEstadocivil;
    }

    public TblEstado getIdEstado() {
        return idEstado;
    }

    public void setIdEstado(TblEstado idEstado) {
        this.idEstado = idEstado;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idEstadocivil != null ? idEstadocivil.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tblestadocivil)) {
            return false;
        }
        Tblestadocivil other = (Tblestadocivil) object;
        if ((this.idEstadocivil == null && other.idEstadocivil != null) || (this.idEstadocivil != null && !this.idEstadocivil.equals(other.idEstadocivil))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "" + desEstadocivil + "";
    }
    
}
